﻿namespace PhotoMap
{
    public class NokiaMapsTileSourceBase
    : Microsoft.Phone.Controls.Maps.TileSource
    {
        protected NokiaMapsTileSourceBase(string uriFormat)
            : base(uriFormat)
        {
        }
        static int _tile_count = 0;
        static string token = "<PUT YOUR Token HERE>";
        static string appId = "<PUT YOUR AppID HERE>";
        public override System.Uri GetUri(int x, int y, int zoomLevel)
        {
            var str = string.Format(UriFormat,  1, zoomLevel, x, y, token, appId);
            return new System.Uri(str);
        }
    }
    /// <summary>
    /// 地圖檢視
    /// </summary>
    public class NokiaMapsRoadTileSource : NokiaMapsTileSourceBase
    {
        public NokiaMapsRoadTileSource()
            : base("http://{0}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day/{1}/{2}/{3}/256/png8?lg=CHI&token={4}&appId={5}")
        {
        }
    }

    /// <summary>
    /// 衛星檢視 ( Satellite View )
    /// </summary>
    public class NokiaMapsSatelliteTileSource : NokiaMapsTileSourceBase
    {
        public NokiaMapsSatelliteTileSource()
            : base("http://{0}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/hybrid.day/{1}/{2}/{3}/256/png8?lg=CHI&token={4}&appId={5}")
        {
        }
    }

    /// <summary>
    /// 地形檢視 ( Terrain View )
    /// </summary>
    public class NokiaMapsTerrainTileSource : NokiaMapsTileSourceBase
    {
        public NokiaMapsTerrainTileSource()
            : base("http://{0}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/terrain.day/{1}/{2}/{3}/256/png8?lg=CHI&token={4}&appId={5}")
        {
        }
    }
}
